void init_UART0(void)
{	
	uint32_t gpio0_cfg = *pREG_GPIO0_CFG;
	gpio0_cfg &= ~(BITM_GPIO_CFG_PIN10 | BITM_GPIO_CFG_PIN11);
	gpio0_cfg |= (1u << BITP_GPIO_CFG_PIN10) | (1u << BITP_GPIO_CFG_PIN11);
	*pREG_GPIO0_CFG = gpio0_cfg;
	
	adi_uart_Open(0,ADI_UART_DIR_BIDIRECTION,&UartDeviceMem,ADI_UART_BIDIR_MEMORY_SIZE,&handle_UART0);
	
	
	uint32_t pAutobaudErrors_UART0;
	
	adi_uart_SetRxFifoTriggerLevel(handle_UART0,ADI_UART_RX_FIFO_TRIG_LEVEL_1BYTE);
	adi_uart_EnableFifo(handle_UART0,true);
	
	adi_uart_SetConfiguration(handle_UART0,ADI_UART_NO_PARITY,ADI_UART_ONE_STOPBIT,ADI_UART_WORDLEN_8BITS);  //0校验 1停止 8带宽
	
//	adi_uart_FlushTxFifo(handle_UART0);
//	adi_uart_FlushRxFifo(handle_UART0);
	adi_uart_ConfigBaudRate(handle_UART0,4,1,1563,3);	
	
	adi_uart_RegisterCallback(handle_UART0,callback_UART0,NULL);
	
	uint8_t pBuffer_TX[4]="INIT";  //发送'0'
//	uint16_t pBuffer_RX;  //接收
	adi_uart_Write(handle_UART0,&pBuffer_TX,4,false,&pAutobaudErrors_UART0);  //阻塞发送
//	adi_uart_SubmitRxBuffer(handle_UART0,&pBuffer_RX,1,true);  //非阻塞接收	
}


void callback_UART0(void	*pCBParam,uint32_t	Event,void	*pArg)
{
//	adi_uart_FlushRxChannel(handle_UART0);	
	adi_uart_GetRX(handle_UART0,&UART0_RX);		
	if(UART0_RX=='$')
	{
		memset(UART0_RX_Buf,0,sizeof(UART0_RX_Buf));
		UART0_RX_Buf_Count=0;
		GPS_End_Count=0;
	}
	if(UART0_RX=='*')
	{
		GPS_End_Count=UART0_RX_Buf_Count;
	}
	UART0_RX_Buf[UART0_RX_Buf_Count]=UART0_RX;
	UART0_RX_Buf_Count++;
	UART0_RX_Flag=1;	
}

